# -*- coding: utf-8 -*-

###########################################################################
## Python code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3)
## http://www.wxformbuilder.org/
##
## PLEASE DO *NOT* EDIT THIS FILE!
###########################################################################

import wx
import wx.xrc
import wx.propgrid as pg
import wx.richtext

ID_ = 1000
ID_数据 = 1001

###########################################################################
## Class MainWindow
###########################################################################

class MainWindow ( wx.Frame ):

	def __init__( self, parent ):
		wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = u"AI量化投资系统", pos = wx.DefaultPosition, size = wx.Size( 850,637 ), style = wx.DEFAULT_FRAME_STYLE|wx.MAXIMIZE|wx.TAB_TRAVERSAL )

		self.SetSizeHints( wx.DefaultSize, wx.DefaultSize )

		self.m_statusBar = self.CreateStatusBar( 1, wx.STB_SIZEGRIP, wx.ID_ANY )
		self.m_menubar = wx.MenuBar( 0 )
		self.file = wx.Menu()
		self.exit = wx.MenuItem( self.file, ID_, u"退出", wx.EmptyString, wx.ITEM_NORMAL )
		self.file.Append( self.exit )

		self.m_menubar.Append( self.file, u"文件" )

		self.tools = wx.Menu()
		self.update = wx.MenuItem( self.tools, ID_数据, u"下载数据", wx.EmptyString, wx.ITEM_NORMAL )
		self.tools.Append( self.update )

		self.m_menubar.Append( self.tools, u"工具" )

		self.about = wx.Menu()
		self.m_menubar.Append( self.about, u"关于" )

		self.SetMenuBar( self.m_menubar )

		bSizer4 = wx.BoxSizer( wx.VERTICAL )

		self.m_notebook = wx.Notebook( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, 0 )
		self.m_panel_main = wx.Panel( self.m_notebook, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
		bSizer1 = wx.BoxSizer( wx.HORIZONTAL )

		self.m_splitter = wx.SplitterWindow( self.m_panel_main, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.SP_3D )
		self.m_splitter.Bind( wx.EVT_IDLE, self.m_splitterOnIdle )
		self.m_splitter.SetMinimumPaneSize( 100 )

		self.m_panel3 = wx.Panel( self.m_splitter, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
		bSizer12 = wx.BoxSizer( wx.VERTICAL )

		self.m_tree_strategies = wx.TreeCtrl( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.Size( -1,300 ), wx.TR_DEFAULT_STYLE|wx.TR_MULTIPLE )
		self.m_tree_strategies.SetForegroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_BTNTEXT ) )

		self.m_menu_tree = wx.Menu()
		self.m_menuitem_del = wx.MenuItem( self.m_menu_tree, wx.ID_ANY, u"删除任务", wx.EmptyString, wx.ITEM_NORMAL )
		self.m_menu_tree.Append( self.m_menuitem_del )

		self.m_tree_strategies.Bind( wx.EVT_RIGHT_DOWN, self.m_tree_strategiesOnContextMenu )

		bSizer12.Add( self.m_tree_strategies, 0, wx.ALL|wx.EXPAND|wx.FIXED_MINSIZE, 5 )

		bSizer10 = wx.BoxSizer( wx.HORIZONTAL )

		self.m_button_add = wx.Button( self.m_panel3, wx.ID_ANY, u"添加任务", wx.DefaultPosition, wx.DefaultSize, 0 )
		bSizer10.Add( self.m_button_add, 0, wx.ALL, 5 )

		self.m_button_del = wx.Button( self.m_panel3, wx.ID_ANY, u"删除任务", wx.DefaultPosition, wx.DefaultSize, 0 )
		bSizer10.Add( self.m_button_del, 0, wx.ALL, 5 )

		self.m_button_bkt = wx.Button( self.m_panel3, wx.ID_ANY, u"开始回测", wx.DefaultPosition, wx.DefaultSize, 0 )
		bSizer10.Add( self.m_button_bkt, 0, wx.ALL, 5 )


		bSizer12.Add( bSizer10, 1, 0, 5 )

		bSizer11 = wx.BoxSizer( wx.VERTICAL )

		self.m_gauge = wx.Gauge( self.m_panel3, wx.ID_ANY, 100, wx.DefaultPosition, wx.Size( 200,-1 ), wx.GA_HORIZONTAL )
		self.m_gauge.SetValue( 0 )
		bSizer11.Add( self.m_gauge, 0, wx.ALL, 5 )

		self.m_pg_analysis = pg.PropertyGrid(self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.Size( 218,200 ), wx.propgrid.PG_DEFAULT_STYLE)
		bSizer11.Add( self.m_pg_analysis, 0, wx.ALL, 5 )

		self.m_button_results = wx.Button( self.m_panel3, wx.ID_ANY, u"结果分析", wx.DefaultPosition, wx.DefaultSize, 0 )
		bSizer11.Add( self.m_button_results, 0, wx.ALL, 5 )

		self.m_text_msg = wx.richtext.RichTextCtrl( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( -1,100 ), 0|wx.VSCROLL|wx.HSCROLL|wx.NO_BORDER|wx.WANTS_CHARS )
		self.m_text_msg.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_3DLIGHT ) )

		bSizer11.Add( self.m_text_msg, 1, wx.EXPAND |wx.ALL, 5 )


		bSizer12.Add( bSizer11, 1, wx.EXPAND, 5 )


		self.m_panel3.SetSizer( bSizer12 )
		self.m_panel3.Layout()
		bSizer12.Fit( self.m_panel3 )
		self.m_panel41 = wx.Panel( self.m_splitter, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
		bSizer13 = wx.BoxSizer( wx.VERTICAL )

		self.m_tabs_results = wx.Notebook( self.m_panel41, wx.ID_ANY, wx.DefaultPosition, wx.Size( -1,-1 ), 0 )

		bSizer13.Add( self.m_tabs_results, 1, wx.EXPAND |wx.ALL, 5 )


		self.m_panel41.SetSizer( bSizer13 )
		self.m_panel41.Layout()
		bSizer13.Fit( self.m_panel41 )
		self.m_splitter.SplitVertically( self.m_panel3, self.m_panel41, 0 )
		bSizer1.Add( self.m_splitter, 1, wx.EXPAND, 5 )


		self.m_panel_main.SetSizer( bSizer1 )
		self.m_panel_main.Layout()
		bSizer1.Fit( self.m_panel_main )
		self.m_notebook.AddPage( self.m_panel_main, u"可视化回测系统", True )

		bSizer4.Add( self.m_notebook, 1, wx.EXPAND |wx.ALL, 5 )


		self.SetSizer( bSizer4 )
		self.Layout()

		self.Centre( wx.BOTH )

	def __del__( self ):
		pass

	def m_splitterOnIdle( self, event ):
		self.m_splitter.SetSashPosition( 0 )
		self.m_splitter.Unbind( wx.EVT_IDLE )

	def m_tree_strategiesOnContextMenu( self, event ):
		self.m_tree_strategies.PopupMenu( self.m_menu_tree, event.GetPosition() )


